<!DOCTYPE html>
<html>
    <head>
        <script>
        function changetext(id){
            id.innerHTML="谢谢";
        }
        </script>
        <body>
            <h1 onclick="changetext(this)">请点击该文本</h1>
        </body>
    </head>
</html>